import mod_item
from mod_verbs import Verb

class EquipArmor(Verb):
    def __init__(self):
        Verb.__init__(self,'EQUIP','BUTTON_EQUIP',5)

    def doIt(self,actor,item,target):
        actor.useAP(self.AP)
        actor.equipItem(item)
        
    def isPossible(self,actor,item,target):
        return Verb.isPossible(self,actor,item,target) and not item.equipped and item.eqLoc not in actor.eqMap
        
class UnequipArmor(Verb):
    def __init__(self):
        Verb.__init__(self,'UNEQUIP','BUTTON_UNEQUIP',5)

    def doIt(self,actor,item,target):
        actor.useAP(self.AP)
        actor.unequipItem(item)
        
    def isPossible(self,actor,item,target):
        return Verb.isPossible(self,actor,item,target) and item.equipped and actor.eqMap[item.eqLoc] == item

fireproofSuitPrototype = mod_item.ItemPrototype('FIREPROOF SUIT',grabbable=True,eqLoc="torso")
fireproofSuitPrototype.verbs.append(EquipArmor())
fireproofSuitPrototype.verbs.append(UnequipArmor())
fireproofSuitPrototype.resistanceMap['fire'] = 0.0
fireproofSuitPrototype.damageTakeMap = {'fire':1.0}